﻿<%@ Import Namespace="MVCMessage"%><%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<string>" %>
<div id="messagewrapper" style="display:none">
	<%if (!string.IsNullOrEmpty(Model))
  {
      var s = Model.Split('#');
       string messType = string.Empty;
       if (s[0] == "0") messType = "error";
       else messType = "message";
       %>
	<div class="<%=messType%>box">
	    <img src="/images/delete22.png" class="close_message" onclick="CloseMessage();" style="float:right;cursor:pointer;padding-left:10px;" alt="Close" />
        <%=s[1].ToString()%>
	</div>	
	<%}%>
</div>
<script type="text/javascript">
	$(document).ready(function() {
		// Display messages on page load if the #messagewrapper has content
		if ($("#messagewrapper").children().length > 0) {
			displayMessages();
		}
	});	
</script>
